package com.practice.share.config;


import com.practice.share.handlerInterceptor.MyInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * 拦截器配置
 */
@Configuration
public class FilterConfig implements WebMvcConfigurer {

    @Bean
    public MyInterceptor getMyInterceptor() {
        return new MyInterceptor();
    }


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //拦截器如果有注入其他则使用这种,都可以
        registry.addInterceptor(getMyInterceptor()).addPathPatterns("/wx/**").excludePathPatterns("/wx/Login").excludePathPatterns("/wx/api/**");
    }


}
